package com.vhall.component.controller.goods;

import com.vhall.component.controller.goods.facade.GoodsConsoleFacade;
import com.vhall.component.entity.goods.goods.*;
import com.vhall.component.framework.common.annotation.VhallComponent;
import com.vhall.component.plugin.common.annotation.TokenAuth;
import com.vhall.component.service.goods.GoodsConsoleService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * console端接口
 *
 * @author guoxin.wang
 * @date 2021-10-12 14:02
 */
@VhallComponent
public class GoodsConsoleController implements GoodsConsoleFacade {

    @Autowired
    private GoodsConsoleService goodsConsoleService;

    @TokenAuth
    @Override
    public Boolean create(GoodsConsoleCreateReqVO reqVO) {
        return goodsConsoleService.create(reqVO);
    }

    @TokenAuth
    @Override
    public Boolean delete(GoodsConsoleDeleteReqVO reqVO) {
        return goodsConsoleService.delete(reqVO);
    }

    @TokenAuth
    @Override
    public Boolean update(GoodsConsoleUpdateReqVO reqVO) {
        return goodsConsoleService.update(reqVO);
    }

    @TokenAuth
    @Override
    public GoodsRspVO get(GoodsConsoleGetReqVO reqVO) {
        GoodsDetailReqVO param = new GoodsDetailReqVO();
        param.setBgId(reqVO.getBgId());
        return goodsConsoleService.get(param);
    }

    @TokenAuth
    @Override
    public GoodsPageVO<GoodsRspVO> list(GoodsConsoleListReqVO reqVO) {
        return goodsConsoleService.list(reqVO);
    }
}
